Skip to content

Allow httpAdditionalHeaders to contain Strings or NSStrings #625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2016

Conversation

seabaylea
Copy link
Contributor

NSURLSessionConfiguration.httpAdditonalHeaders is declared to accept [AnyHashable:Any], but internally this maps to [String : String].

Currently the code assumes that the [AnyHashable:Any] actually only contains NSStrings, whereas on macOS/Darwin its acceptable for either NSStrings or Strings to be used.

I've therefore updated URLSession._Configuration.convertToStringString() to allow either and coerce to String if needed.

@parkera
Copy link
Contributor

parkera commented Sep 12, 2016

Cool

@parkera
Copy link
Contributor

parkera commented Sep 12, 2016

@swift-ci please test

@parkera parkera merged commit f37bd60 into swiftlang:master Sep 13, 2016
pushkarnk pushed a commit to pushkarnk/swift-corelibs-foundation that referenced this pull request Sep 23, 2016
pushkarnk pushed a commit to pushkarnk/swift-corelibs-foundation that referenced this pull request Sep 23, 2016
parkera pushed a commit that referenced this pull request Sep 26, 2016
* Test case to test TimeZone.localizedName

* Allow httpAdditionalHeaders to contain Strings or NSStrings (#625)

* Switch to Error from NSError for API conformance

* Fix for a URLSession crash (SR-2630)

* If present, pass URLRequest.httpBody to the dataTask (#633)

* Set Content-Type to application/x-www-form-urlencoded for POST requests

* Update NSURLSession.swift

* Fix for SR-2631 and implementation of URLSession.finishTasksAndInvalidate

* Allow numeric types in NSNumberFormatter.string(for:)[SR-2477] (#643)

* Fix for [SR-2486] Crash in NSDictionary.description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants